package com.heima.article.listener;

import com.alibaba.fastjson.JSON;
import com.heima.article.dto.ArticleStreamMessage;
import com.heima.article.service.IComputeService;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;

//@Service
public class HotResultListener {

   /* @Autowired
    private IComputeService computeService;

    @KafkaListener(topics = "${topic.hotArticleResultTopic}")
    public void handleMessage(ConsumerRecord<String, String> record) {
        System.out.println("接收到消息为: " + record.value());
        ArticleStreamMessage articleStreamMessage = JSON.parseObject(record.value(), ArticleStreamMessage.class);
        computeService.update(articleStreamMessage);
    }*/
}
